// stores/reportStore.ts
import { defineStore } from 'pinia'

// 定义类型
type ReportFlag = 'diagram' | 'noDiagram'

interface ReportFlagOption {
  value: ReportFlag
  label: string
}

interface ReportState {
  reportFlag: ReportFlag
}

export const useReportStore = defineStore('report', {
  state: (): ReportState => ({
    reportFlag: 'diagram' // 默认值
  }),
  actions: {
    setReportFlag(value: ReportFlag): void {
      this.reportFlag = value
    }
  },
  getters: {
    // 如果需要可以添加 getters
    getReportFlag(): ReportFlag {
      return this.reportFlag
    }
  }
})

// 导出类型以便在其他组件中使用
export type { ReportFlag, ReportFlagOption }